<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $backendPluginName; ?>
		<?php echo $title_for_layout; ?>
	</title>

	<?php
		echo $this->Html->meta('icon');

        echo $this->Html->css('https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css');
        echo $this->Html->css('https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css');
        echo $this->Html->css('/' . $backendPluginNameUnderscored . '-plugin/css/styles.css');
    ?>
        <!--[if lt IE 9]>
			<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
    <?php    
        //echo $this->Html->script('/' . $backendPluginNameUnderscored . '-plugin/js/vendors.min.js');
        echo $this->Html->script('/' . $backendPluginNameUnderscored . '-plugin/js/ckeditor/ckeditor.js');
        echo $this->Html->script('/' . $backendPluginNameUnderscored . '-plugin/js/ckfinder/ckfinder.js');
        
		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>
<body>
<div class="page-container">
	<!-- top navbar -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="row" style="padding: 0 40px">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="offcanvas" data-target=".sidebar-nav">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
               <a class="navbar-brand" href="/admin"><?php echo $backendPluginName; ?></a>
            </div>
            <ul class="nav pull-right">
                <li><?php echo $this->Html->link('Logout', '/' . $backendPluginNameUnderscored . '/users/logout');?></li>
            </ul>
        </div>
    </div>
      
	<div class="row-offcanvas row-offcanvas-left">
        <!-- sidebar -->
        <div class="col-xs-6 col-sm-2 sidebar-offcanvas" id="sidebar" role="navigation">
            <ul class="nav nav-pills nav-stacked">
                <li <?php echo ($this->params['controller'] == 'admin_registers')? 'class="active"':'' ?>><?php echo $this->Html->link('Registers', '/' . $backendPluginNameUnderscored . '/registers');?></li>
                <li <?php echo ($this->params['controller'] == 'admin_contents')? 'class="active"':'' ?>><?php echo $this->Html->link('Contents', '/' . $backendPluginNameUnderscored . '/contents');?></li>    
                <li <?php echo ($this->params['controller'] == 'admin_categories')? 'class="active"':'' ?>><?php echo $this->Html->link('Categories', '/' . $backendPluginNameUnderscored . '/categories');?></li> 
                <li <?php echo ($this->params['controller'] == 'admin_users')? 'class="active"':'' ?>><?php echo $this->Html->link('Users', '/' . $backendPluginNameUnderscored . '/users');?></li>
            </ul>
        </div>
        <!-- main area -->
        <div class="col-xs-12 col-sm-10" style="border-left: 1px solid #cccccc;">
            <?php echo $this->Session->flash('bad', array('params' => array('class' => 'alert alert-error'))); ?>
            <?php echo $this->Session->flash('good', array('params' => array('class' => 'alert alert-success'))); ?>

			<?php echo $this->fetch('content'); ?>
        </div><!-- /.col-xs-12 main -->
    </div><!--/.row-->
</div><!--/.page-container-->
<?php echo $this->Html->script('https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js');?>
<?php echo $this->Html->script('/' . $backendPluginNameUnderscored . '-plugin/js/admin.min.js'); ?>
<?php echo $this->Html->script('https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js'); ?>
<?php echo $this->Html->script('/' . $backendPluginNameUnderscored . '-plugin/js/scripts.js'); ?>

<?php echo $this->Js->writeBuffer(); ?>
</body>
</html>
